package com.shangxian.giveithome.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 宠物表
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Pet {


    /****/
    private Long id;

    /**
     * 协会id
     **/
    private Long meId;

    /**
     * 用户id
     **/
    private Long usId;

    /**
     * 姓名
     **/
    private String name;

    /**
     * 品种 0 未知
     **/
    private String varieties;

    /**
     * 宠物类型
     */
    private String type;

    /**
     * 年龄
     **/
    private String age;

    /**
     * 性别
     **/
    private String sex;

    /**
     * 归属
     **/
    private Integer subordinate;

    /**
     * 描述
     **/
    private String describe;

    /**
     * 是否绝育 未知 已绝育 未绝育
     **/
    private String sterilization;

    /**
     * 是否疫苗 未知  已疫苗 未疫苗
     **/
    private String vaccine;

    /**
     * 创建时间
     **/
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date createTime;


    public Pet(Pet pet) {
        this.id = pet.getId();
        this.meId = pet.getMeId();
        this.usId = pet.getUsId();
        this.name = pet.getName();
        this.varieties = pet.getVarieties();
        this.subordinate = pet.getSubordinate();
        this.type = pet.getType();
        this.age = pet.getAge();
        this.sex = pet.getSex();
        this.describe = pet.getDescribe();
        this.sterilization = pet.getSterilization();
        this.vaccine = pet.getVaccine();
        this.createTime = pet.getCreateTime();
    }
}
